/**
 * 
 */
function saveConfig()
{
	openConfirmBox();
//	var conf = confirm("Are you sure ?");
//	if (conf)
//		{
//			comfirmDialogHandler();
//		}
}

function reLoad()
{
	window.location.href="skippedRecipeCondition.do";
}

function comfirmDialogHandler()
{
	if (!isNaN(document.conditionForm.baseLeadTime.value)
		    && !isNaN(document.conditionForm.runTime.value)
		    && !isNaN(document.conditionForm.waitTime.value))
			{
				$('body').append('<div class="ui-widget-overlay" style="width: '+screen.width+'px; height: '+screen.height+'px; z-index: 1001;">'+							
						'</div>'+
						'<div class="waiting-message" >'+
						'<font color="#2E6E9E">Saving...</font>'+
					'</div>'
						);
				document.conditionForm.submit();
			}
		else
			{
				$( "#dialog-message" ).dialog("open");
			}
}

$(function() {
	declareConfirmBox('comfirmDialogHandler');
    $( "#dialog-message" ).dialog({
        modal: true,
        autoOpen: false,
        buttons: {
            Ok: function() {
                $( this ).dialog( "close" );
            }
        }
    });
});